Optimal. Leaf size=82 \[ \frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {(b c-a d) (3 b c+a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {398, 393, 211}
\begin {gather*} -\frac {(b c-a d) (a d+3 b c) \text {ArcTan}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}+\frac {x (b c-a d)^2}{2 c d^2 \left (c+d x^2\right )}+\frac {b^2 x}{d^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 393
Rule 398
Rubi steps
\begin {align*} \int \frac {\left (a+b x^2\right )^2}{\left (c+d x^2\right )^2} \, dx &=\int \left (\frac {b^2}{d^2}-\frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{d^2 \left (c+d x^2\right )^2}\right ) \, dx\\ &=\frac {b^2 x}{d^2}-\frac {\int \frac {b^2 c^2-a^2 d^2+2 b d (b c-a d) x^2}{\left (c+d x^2\right )^2} \, dx}{d^2}\\ &=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {((b c-a d) (3 b c+a d)) \int \frac {1}{c+d x^2} \, dx}{2 c d^2}\\ &=\frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {(b c-a d) (3 b c+a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 89, normalized size = 1.09 \begin {gather*} \frac {b^2 x}{d^2}+\frac {(b c-a d)^2 x}{2 c d^2 \left (c+d x^2\right )}-\frac {\left (3 b^2 c^2-2 a b c d-a^2 d^2\right ) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{2 c^{3/2} d^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.07, size = 92, normalized size = 1.12
method | result | size |
default | \(\frac {b^{2} x}{d^{2}}+\frac {\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 c \left (d \,x^{2}+c \right )}+\frac {\left (a^{2} d^{2}+2 a b c d -3 b^{2} c^{2}\right ) \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 c \sqrt {c d}}}{d^{2}}\) | \(92\) |
risch | \(\frac {b^{2} x}{d^{2}}+\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 c \,d^{2} \left (d \,x^{2}+c \right )}-\frac {\ln \left (d x +\sqrt {-c d}\right ) a^{2}}{4 \sqrt {-c d}\, c}-\frac {\ln \left (d x +\sqrt {-c d}\right ) a b}{2 d \sqrt {-c d}}+\frac {3 c \ln \left (d x +\sqrt {-c d}\right ) b^{2}}{4 d^{2} \sqrt {-c d}}+\frac {\ln \left (-d x +\sqrt {-c d}\right ) a^{2}}{4 \sqrt {-c d}\, c}+\frac {\ln \left (-d x +\sqrt {-c d}\right ) a b}{2 d \sqrt {-c d}}-\frac {3 c \ln \left (-d x +\sqrt {-c d}\right ) b^{2}}{4 d^{2} \sqrt {-c d}}\) | \(202\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 96, normalized size = 1.17 \begin {gather*} \frac {{\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x}{2 \, {\left (c d^{3} x^{2} + c^{2} d^{2}\right )}} + \frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 141 vs.
\(2 (70) = 140\).
time = 1.12, size = 302, normalized size = 3.68 \begin {gather*} \left [\frac {4 \, b^{2} c^{2} d^{2} x^{3} + {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {-c d} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right ) + 2 \, {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{4 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}, \frac {2 \, b^{2} c^{2} d^{2} x^{3} - {\left (3 \, b^{2} c^{3} - 2 \, a b c^{2} d - a^{2} c d^{2} + {\left (3 \, b^{2} c^{2} d - 2 \, a b c d^{2} - a^{2} d^{3}\right )} x^{2}\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right ) + {\left (3 \, b^{2} c^{3} d - 2 \, a b c^{2} d^{2} + a^{2} c d^{3}\right )} x}{2 \, {\left (c^{2} d^{4} x^{2} + c^{3} d^{3}\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 236 vs.
\(2 (73) = 146\).
time = 0.38, size = 236, normalized size = 2.88 \begin {gather*} \frac {b^{2} x}{d^{2}} + \frac {x \left (a^{2} d^{2} - 2 a b c d + b^{2} c^{2}\right )}{2 c^{2} d^{2} + 2 c d^{3} x^{2}} - \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (- \frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} + \frac {\sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (\frac {c^{2} d^{2} \sqrt {- \frac {1}{c^{3} d^{5}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.07, size = 95, normalized size = 1.16 \begin {gather*} \frac {b^{2} x}{d^{2}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{2 \, \sqrt {c d} c d^{2}} + \frac {b^{2} c^{2} x - 2 \, a b c d x + a^{2} d^{2} x}{2 \, {\left (d x^{2} + c\right )} c d^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.09, size = 124, normalized size = 1.51 \begin {gather*} \frac {b^2\,x}{d^2}+\frac {x\,\left (a^2\,d^2-2\,a\,b\,c\,d+b^2\,c^2\right )}{2\,c\,\left (d^3\,x^2+c\,d^2\right )}+\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{\sqrt {c}\,\left (a^2\,d^2+2\,a\,b\,c\,d-3\,b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{2\,c^{3/2}\,d^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________